/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.persistencia.domain;

import java.io.Serializable;
import java.util.List;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author kenny
 */
@Entity
@Table(name = "recurso")
@NamedQueries({
    @NamedQuery(name = "Recurso.findAll", query = "SELECT r FROM Recurso r"),
    @NamedQuery(name = "Recurso.findByNRcrId", query = "SELECT r FROM Recurso r WHERE r.nRcrId = :nRcrId"),
    @NamedQuery(name = "Recurso.findByVNombre", query = "SELECT r FROM Recurso r WHERE r.vNombre = :vNombre"),
    @NamedQuery(name = "Recurso.findByNCntReal", query = "SELECT r FROM Recurso r WHERE r.nCntReal = :nCntReal"),
    @NamedQuery(name = "Recurso.findByNCntActual", query = "SELECT r FROM Recurso r WHERE r.nCntActual = :nCntActual"),
    @NamedQuery(name = "Recurso.findByVEstado", query = "SELECT r FROM Recurso r WHERE r.vEstado = :vEstado")})
public class Recurso implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "nRcrId")
    private Integer nRcrId;
    @Size(max = 60)
    @Column(name = "vNombre")
    private String vNombre;
    @Column(name = "nCntReal")
    private Integer nCntReal;
    @Column(name = "nCntActual")
    private Integer nCntActual;
    @Size(max = 1)
    @Column(name = "vEstado")
    private String vEstado;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "recurso")
    private List<Clasexrecurso> clasexrecursoList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "recurso")
    private List<Salonxrecurso> salonxrecursoList;

    public Recurso() {
    }

    public Recurso(Integer nRcrId) {
        this.nRcrId = nRcrId;
    }

    public Integer getNRcrId() {
        return nRcrId;
    }

    public void setNRcrId(Integer nRcrId) {
        this.nRcrId = nRcrId;
    }

    public String getVNombre() {
        return vNombre;
    }

    public void setVNombre(String vNombre) {
        this.vNombre = vNombre;
    }

    public Integer getNCntReal() {
        return nCntReal;
    }

    public void setNCntReal(Integer nCntReal) {
        this.nCntReal = nCntReal;
    }

    public Integer getNCntActual() {
        return nCntActual;
    }

    public void setNCntActual(Integer nCntActual) {
        this.nCntActual = nCntActual;
    }

    public String getVEstado() {
        return vEstado;
    }

    public void setVEstado(String vEstado) {
        this.vEstado = vEstado;
    }

    public List<Clasexrecurso> getClasexrecursoList() {
        return clasexrecursoList;
    }

    public void setClasexrecursoList(List<Clasexrecurso> clasexrecursoList) {
        this.clasexrecursoList = clasexrecursoList;
    }

    public List<Salonxrecurso> getSalonxrecursoList() {
        return salonxrecursoList;
    }

    public void setSalonxrecursoList(List<Salonxrecurso> salonxrecursoList) {
        this.salonxrecursoList = salonxrecursoList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nRcrId != null ? nRcrId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Recurso)) {
            return false;
        }
        Recurso other = (Recurso) object;
        if ((this.nRcrId == null && other.nRcrId != null) || (this.nRcrId != null && !this.nRcrId.equals(other.nRcrId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.persistencia.domain.Recurso[ nRcrId=" + nRcrId + " ]";
    }
    
}
